Skip to content

fix: destructure AttachSession tuple for buffer rendering - #53

Merged
joshuapare merged 1 commit into
mainfrom
fix/terminal-attach-buffer-v2
Mar 28, 2026
Merged

fix: destructure AttachSession tuple for buffer rendering#53
joshuapare merged 1 commit into
mainfrom
fix/terminal-attach-buffer-v2

Conversation

@joshuapare

@joshuapare joshuapare commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to fix: render buffered output on terminal session attach #51AttachSession returns a Wails v3 tuple [Session, buffer], not an object
  • result.buffer was undefined on a tuple; destructure as [, buffer] to get the second element
  • Also requires plugin-sdk v0.5.2 which fixes the race between handleStream and AttachSession that could orphan the initial prompt data

Test plan

  • Exec into a pod — initial shell prompt should appear without typing first

Summary by CodeRabbit

Release Notes

No user-visible changes. This release contains internal code optimizations to improve maintainability. Terminal functionality remains unchanged.

AttachSession returns a tuple [Session, buffer], not an object.
The previous fix accessed result.buffer which is undefined on a tuple.
Destructure as [, buffer] to get the second element.
@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 83e06446-c338-4c2f-bbf5-84c2ca20ce6b

📥 Commits

Reviewing files that changed from the base of the PR and between 349eeba and bde31e1.

📒 Files selected for processing (1)
  • ui/providers/BottomDrawer/containers/Terminal.tsx

📝 Walkthrough

Walkthrough

The TerminalContainer in Terminal.tsx refactors its session attachment flow by destructuring only the buffer value from ExecClient.AttachSession() instead of storing the entire result object, then updates corresponding conditional checks and variable references accordingly.

Changes

Cohort / File(s) Summary
Session Attachment Refactoring
ui/providers/BottomDrawer/containers/Terminal.tsx
Changed destructuring pattern from storing full result object to extracting only buffer via array destructuring [, buffer]. Updated conditional logic and variable references from result.buffer to buffer.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐰 The buffer hops free from the result nest,
Destructured with grace—no object to test.
Three lines refined, the logic stays true,
Cleaner and nimbler, a refactor debut! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/terminal-attach-buffer-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joshuapare
joshuapare merged commit 4ac41da into main Mar 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant